﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace WP8.PropiedadesEspeciales.Helpers
{
    public class EstadoEspecial
    {
        public static bool GetEstado(DependencyObject obj)
        {
            return (bool)obj.GetValue(EstadoProperty);
        }

        public static void SetEstado(DependencyObject obj, bool value)
        {
            obj.SetValue(EstadoProperty, value);
        }

        // Using a DependencyProperty as the backing store for Estado.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty EstadoProperty =
            DependencyProperty.RegisterAttached("Estado", typeof(bool), typeof(EstadoEspecial), new PropertyMetadata(true, callback));

        private static void callback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            (d as FrameworkElement).Visibility = (bool)e.NewValue ? Visibility.Visible : Visibility.Collapsed;
        }


    }
}
